import { post, get, upload } from '@/services/request/http';

export const fetchAlbumList = (data?:Record<string, any>) : Promise<any> => {
  return post('/album/list', data);

}

export const saveAlbum = (data: Record<string, any>) : Promise<any> => {
  return post('/album/save', data);
}

export const deleteAlbum = (id: number | string) : Promise<any> => {
  return post('/album/delete', { id });
}

export const fetchAlbumDetail = (id: number | string) : Promise<any> => {
  return get('/album/detail', { id });
}

export const fetchAlbumCategory = (data?: Record<string, any>) : Promise<any> => {
  return post('/album/category/list', data);
}

export const saveAlbumCategory = (data: Record<string, any>) : Promise<any> => {
  return post('/album/category/save', data);
}

export const deleteAlbumCategory = (id: number | string) : Promise<any> => {
  return post('/album/category/delete', { id });
}

export const savePhotos = (data:FormData) : Promise<any> => {
  return upload('/album/photo/add', data);
}

export const deletePhotos = (id: number | string) : Promise<any> => {
  return post('/album/photo/delete', { id });
}

export const fetchPhotoList = (params: Record<string, any>): Promise<any> => {
  return post('/album/photo/list', params)
}
